<!doctype html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>打印页</title>
	<script src="__JS__/jquery.min.js?v={:C('TKE_VERSION')}"></script>
    <script src="__STATIC__/PrintArea-master/js/jquery.printarea.js"></script>
    <script src="__STATIC__/aui-artDialog-9fd667e/dist/dialog.js"></script>
    <link rel="stylesheet" href="__STATIC__/aui-artDialog-9fd667e/css/ui-dialog.css">
	<link rel="stylesheet" href="__CSS__/print.css">
</head>
<body>
    <div id="j-pager" class="g-paper">
        <div class="header">
            <h1>家家户户网家博会线上退款凭证</h1>
        </div>
        <div class="body">
            <p>线上订单号：{$info.order_id|paperOrderPad}</p>
            <p>纸质订单号：{$info.paper_order|paperOrderPad}</p>
            <p>退款方式：{$info.pay_type|get_pay_title}</p>
            <p>打印时间：{:time_format(NOW_TIME)}</p>
            <if condition="$info['customer_name']"><p>客户姓名：{$info.customer_name}</p></if>
            <p>联系电话：{$info.customer_id|getCustomerName}</p>
            <p>商户：{$info.merchant_id|getMerchantName}</p>
            <if condition="$info['merchant_address'] neq ''"><p>商户地址：{$info.merchant_address}</p></if>
            <if condition="$info['merchant_fixed_phone'] neq ''"><p>商户电话：{$info.merchant_fixed_phone}</p></if>
            <p>店铺：{$info.shop_id|getShopName}</p>
            <p>品类：{$info.conf_category_id|getConfCategoryName}</p>
            <if condition="$order_snap neq null">
	            <p>所购商品：{$order_snap.goods_name}</p>
	            <p>{$order_snap.goods_title}</p>
	            <p>{$order_snap.goods_introduction}</p>
	            <p>市场价：{$order_snap.market_price}</p>
	            <p>活动价：{$order_snap.shop_price}</p>
	            <p>定金：{$order_snap.goods_deposit}</p>
            </if>
            <p>退款金额：{$info.amount}</p>
        </div>
        
        <div class="foot">
            <p align="center" calss="tel">服务电话：4008-168-333</p>
            <p align="center" class="url">www.hrbjjhh.com</p>
        </div>
    </div>
	<form autocomplete="off">
		<input type="hidden" value="{$info.order_id}" name="id" >
	    <input type="hidden" value="apply_refund" name="method" >
    </form>

<script>
var index = 0;
function call_back(data){
	window.opener.location.reload();
	window.close();
}

dialog({
	"fixed": true,
	"width": 320,
	"title": "提示",
	"content": "您是否已经打印完毕?",
	"okValue": "打印成功",
	"ok": function(){
		if(index == 0){
			index = 1;
			$.post("{:U('Order/orderStatus')}", $('form').serialize(), call_back, "json");
		}
		return false;
	},
	"cancelValue": "打印失败",
	"cancel": function(){
		var d_confirm = dialog({
		    "width": 240,
		    "title": "提示",
		    "content": "是否确认打印失败？",
		    "ok": function(){
				window.close();
		    }, 
		    "okValue": "确定",
		    "cancelValue": "取消",
		    "cancel": function(){}
		}).showModal();
		return false;
	}
}).showModal();

$("#j-pager").printArea();
$('[i-id=cancel]').attr('style','margin-right:150px;')
</script>
</body>
</html>